<!doctype html>
<html class="no-js" lang="">

<head>
  <title></title>
  <meta charset="utf-8">
  <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
</head>

<body>
  <script type="text/javascript">
    dojo.declare("Customer",null,{
      constructor:function(name){
        // 定义的构造方法,创建这个对象的时候会执行
        this.name = name;
      },
      say:function(){
        alert("Hello " + this.name);
      },
      getDiscount:function(){
        alert("Discount is 1.0");
      }
    });

    // 继承
    dojo.declare("VIP", Customer,{
      getDiscount:function(){
        alert("Discount is 0.8");
        this.inherited(arguments);
      }
    });
    var vip = new VIP("Mark");
    vip.say();
    vip.getDiscount();

  </script>
</body>
</html>
